﻿<%@ Page Language="C#" MasterPageFile="~/SiteLayout.Master" AutoEventWireup="true" CodeBehind="AddTrees.aspx.cs" Inherits="ForestryEnterprise.AddTree" %>

<asp:Content ID="Content2" ContentPlaceHolderID="context" runat="server">
    <h2>Add Tree</h2>
    <hr />
    <table style="border-collapse:collapse;">
        <tr>
            <td class="infoSection" colspan="2">
                <h3>Basic info</h3>
                <asp:Label ID="err" runat="server" style="float:right; color:Red;"/>
                <asp:Image ID="treeImage" ImageUrl="~/Images/Trees/defaultTreeImage.png" runat="server"/>

                    <table>
                    <tr>
                        <td>
                            Name:
                        </td>

                        <td>
                            <asp:TextBox ID="treeName" runat="server" />
                                
                            <asp:RequiredFieldValidator ID="reqName" ControlToValidate="treeName" ErrorMessage="Input name" runat="server"/>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Age:
                        </td>

                        <td>
                            <asp:TextBox ID="treeAge" runat="server" />
                            <asp:RegularExpressionValidator ID="regAge" ControlToValidate="treeAge" ValidationExpression="[0-9]*" ErrorMessage="Must be number" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Height:
                        </td>

                        <td>
                            <asp:TextBox ID="treeHeight" runat="server" />
                            <asp:RegularExpressionValidator ID="regHeight" ControlToValidate="treeHeight" ValidationExpression="[0-9]*\.?[0-9]*" ErrorMessage="Number (floating point)" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Width:
                        </td>

                        <td>
                            <asp:TextBox ID="treeWidth" runat="server" />
                            <asp:RegularExpressionValidator ID="regWidth" ControlToValidate="treeWidth" ValidationExpression="[0-9]*\.?[0-9]*" ErrorMessage="Number (floating point)" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <a id="changeTreeImage" runat="server">pick image</a>
                        </td>

                        <td>
                            <asp:Label ID="imageSrc" runat="server" />
                        </td>
                    </tr>
                </table>
            </td> 

                <td class="infoSection" colspan="2">
                <h3 style="padding:0px; margin:0px;">Seed info</h3>
                <table>
                    <tr>
                        <td>
                            Color:
                        </td>
                        <td>
                            <asp:TextBox ID="seedColor" runat="server" />
                        </td>
                    </tr>

                    <tr>
                        <td>
                            Weight:
                        </td>
                        <td>
                            <asp:TextBox ID="seedWeight" runat="server" />
                            <asp:RegularExpressionValidator ID="regSeedWeight" ControlToValidate="seedWeight" ValidationExpression="[0-9]*\.?[0-9]*" ErrorMessage="Number (floating point)" runat="server" />
                        </td>
                    </tr>

                    <tr>
                        <td>
                            Description:
                        </td>
                        <td>
                            <asp:TextBox ID="seedDesc" runat="server" Rows="10" Columns="40" TextMode="MultiLine"/>
                        </td>
                    </tr>
                </table>
                </td>
        </tr>
            
        <tr>
            <td class="infoSection" colspan="2">
                <h3 style="padding:0px; margin:0px;">Stem info</h3>
                <table>
                    <tr>
                        <td>
                            Color:
                        </td>
                        <td>
                            <asp:TextBox ID="stemColor" runat="server" />
                        </td>
                    </tr>

                    <tr>
                        <td>
                            Width:
                        </td>
                        <td>
                            <asp:TextBox ID="stemWidth" runat="server" />
                            <asp:RegularExpressionValidator ID="regStemWidth" ControlToValidate="stemWidth" ValidationExpression="[0-9]*\.?[0-9]*" ErrorMessage="Number (floating point)" runat="server" />
                        </td>
                    </tr>

                    <tr>
                        <td>
                            Height:
                        </td>
                        <td>
                            <asp:TextBox ID="stemHeight" runat="server" />
                            <asp:RegularExpressionValidator ID="regStemHeight" ControlToValidate="stemHeight" ValidationExpression="[0-9]*\.?[0-9]*" ErrorMessage="Number (floating point)" runat="server" />
                        </td>
                    </tr>

                    <tr>
                        <td>
                            Description:
                        </td>
                        <td>
                            <asp:TextBox ID="stemDesc" runat="server" Rows="10" Columns="40" TextMode="MultiLine"/>
                        </td>
                    </tr>
                </table>
            </td>

            <td class="infoSection" colspan="2">
                <h3 style="padding:0px; margin:0px;">Skin info</h3>
                <table>
                    <tr>
                        <td>
                            Color:
                        </td>
                        <td>
                            <asp:TextBox ID="skinColor" runat="server" />
                        </td>
                    </tr>

                    <tr>
                        <td>
                            Thickness:
                        </td>
                        <td>
                            <asp:TextBox ID="skinThickness" runat="server" />
                            <asp:RegularExpressionValidator ID="regSkinThickness" ControlToValidate="skinThickness" ValidationExpression="[0-9]*\.?[0-9]*" ErrorMessage="Number (floating point)" runat="server" />
                        </td>
                    </tr>

                    <tr>
                        <td>
                            Description:
                        </td>
                        <td>
                            <asp:TextBox ID="skinDesc" runat="server" Rows="10" Columns="40" TextMode="MultiLine"/>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>

        <tr>
                <td class="infoSection" colspan="2">
                <h3 style="padding:0px; margin:0px;">Leaf info</h3>
                <table>
                    <tr>
                        <td>
                            Color:
                        </td>
                        <td>
                            <asp:TextBox ID="leafColor" runat="server" />
                        </td>
                    </tr>

                    <tr>
                        <td>
                            Thickness:
                        </td>
                        <td>
                            <asp:TextBox ID="leafThickness" runat="server" />
                            <asp:RegularExpressionValidator ID="regLeafThickness" ControlToValidate="leafThickness" ValidationExpression="[0-9]*\.?[0-9]*" ErrorMessage="Number (floating point)" runat="server" />
                        </td>
                    </tr>

                    <tr>
                        <td>
                            Proportion:
                        </td>
                        <td>
                            <asp:TextBox ID="leafProportion" runat="server" />
                            <asp:RegularExpressionValidator ID="regLeafProportion" ControlToValidate="leafProportion" ValidationExpression="[0-9]*:[0-9]*" ErrorMessage="Proportion (n:m)" runat="server" />
                        </td>
                    </tr>

                    <tr>
                        <td>
                            Description:
                        </td>
                        <td>
                            <asp:TextBox ID="leafDesc" runat="server" Rows="10" Columns="40" TextMode="MultiLine"/>
                        </td>
                    </tr>
                </table>
            </td>

            <td class="infoSection" colspan="2">
                    <h3 style="padding:0px; margin:0px;">Fruit info</h3>
                <table>
                    <tr>
                        <td>
                            Color:
                        </td>
                        <td>
                            <asp:TextBox ID="fruitColor" runat="server" />
                        </td>
                    </tr>

                    <tr>
                        <td colspan="2">
                            <asp:CheckBox ID="fruitEatable" Text="Eatable" runat="server"/>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            Description:
                        </td>
                        <td>
                            <asp:TextBox ID="fruitDesc" runat="server" Rows="10" Columns="40" TextMode="MultiLine"/>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <asp:Button ID="add" Text="Add" runat="server" onclick="add_Click" />
    <asp:Button ID="cancel" Text="Cancel" runat="server" onclick="cancel_Click" />
</asp:Content>